home *** CD-ROM | disk | FTP | other *** search
- package asp.wizard.util;
-
- import asp.util.EResourceUtil;
- import asp.util.ResourceUtil;
- import asp.wizard.AspWizardExceptionHandler;
- import com.netobjects.nfc.api.ComponentData;
- import com.netobjects.nfc.api.ComponentInfo;
- import com.netobjects.nfc.api.DNode;
- import java.awt.Container;
- import java.util.Enumeration;
- import java.util.Hashtable;
- import java.util.Vector;
-
- public class NfxUtil {
- // $FF: synthetic field
- static Class class$asp$wizard$WVPanelIntro;
-
- public static boolean componentsInstalled(DNode theDNode) {
- boolean result = false;
- Boolean doesntExist = new Boolean(false);
- Boolean exists = new Boolean(true);
- Hashtable requiredComponents = new Hashtable();
- requiredComponents.put("asp.nfx.MSDBConnection.MSDBConnection", doesntExist);
- requiredComponents.put("asp.nfx.MSDBQuery.MSDBQuery", doesntExist);
- requiredComponents.put("asp.nfx.MSDBList.MSDBList", doesntExist);
- requiredComponents.put("asp.nfx.MSDBDynaField.MSDBDynaField", doesntExist);
- requiredComponents.put("asp.nfx.MSDBSearch.MSDBSearch", doesntExist);
- requiredComponents.put("asp.nfx.MSDBUpdate.MSDBUpdate", doesntExist);
- requiredComponents.put("asp.nfx.MSDBNav.MSDBNav", doesntExist);
- String compName = null;
- ComponentInfo myCompInfo = new ComponentInfo();
- ComponentData[] installedComps = myCompInfo.getAllComponentsInstalled("asp.nfx");
-
- for(int i = 0; i < installedComps.length; ++i) {
- compName = installedComps[i].getComponentName();
- if (requiredComponents.containsKey(compName)) {
- requiredComponents.put(compName, exists);
- }
- }
-
- Vector missingComponents = new Vector();
- Object compNameStr = null;
- Enumeration e = requiredComponents.keys();
-
- while(e.hasMoreElements()) {
- compNameStr = e.nextElement();
- if (requiredComponents.get(compNameStr) == doesntExist) {
- missingComponents.addElement(compNameStr);
- }
- }
-
- if (missingComponents.size() > 0) {
- ResourceUtil ru = null;
-
- try {
- ru = ResourceUtil.getResourceUtil("asp.wizard.res", class$asp$wizard$WVPanelIntro != null ? class$asp$wizard$WVPanelIntro : (class$asp$wizard$WVPanelIntro = class$("asp.wizard.WVPanelIntro")));
- } catch (EResourceUtil e) {
- System.err.println(((Throwable)e).getMessage());
- }
-
- String msg = ru.getString("err.msg.cantstart_missingcomponent") + " ";
- StringBuffer sb = new StringBuffer(msg);
-
- for(int i = 0; i < missingComponents.size(); ++i) {
- sb.append(missingComponents.elementAt(i).toString());
- if (i < missingComponents.size() - 1) {
- sb.append(", ");
- }
- }
-
- new AspWizardExceptionHandler((Container)null);
- AspWizardExceptionHandler.showMessage(0, sb.toString());
- } else {
- result = true;
- }
-
- return result;
- }
-
- // $FF: synthetic method
- static Class class$(String class$) {
- try {
- return Class.forName(class$);
- } catch (ClassNotFoundException forName) {
- throw new NoClassDefFoundError(((Throwable)forName).getMessage());
- }
- }
- }
-